

function login() {
		
	    

		var userId = getCookie("userId");
		var userName=getCookie("userName") ;
		var nickName=getCookie("nickName") ;
		
		 if (userName) {
				//alert("欢迎您&nbsp;" + userName);
			// $("#logoutspan").css("display","block");
			 
			 $("#logoutspan").html("<b class='color_red'>登出</b> ");
			 $("#logoutspan").attr("href","#"); 
			 $("a[id='logoutspan']").click(function(){
				 logout();
		       });
			 $("#usernamespan").css("display","block");		
			 $("#userName").attr("href","http://www.51ski.com/userinfo"); 
			 if(nickName){
				 $("#userName").text(decodeURI(nickName));  
			
			 }else{
				 $("#userName").text(userName);  
			 }
			// $("#usernamespan")on("click",function(){
			//	 window.location="http://www.51ski.com/userinfo";	
			// });

			
			} else {
				//alert('empty');
			}

		//alert(userId);
		//alert(userName);
}

	
